<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo2-7</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="app">
        {{data}}
    </div>
</body>
<script>
    const comApp = {
        data() {
            return {
                data: new Date()
            }
        },
        mounted() {
            var _this = this;
            this.timer = setInterval(function () {
                _this.data = new Date().toLocaleString()
            }, 1000);
        }
    }
    Vue.createApp(comApp).mount('#app')
</script>

</html>